package com.ruoyi.lxzx.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.lxzx.mapper.UserIntegralDetailMapper;
import com.ruoyi.lxzx.domain.UserIntegralDetail;
import com.ruoyi.lxzx.service.IUserIntegralDetailService;

/**
 * 用户积分明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-10-26
 */
@Service
public class UserIntegralDetailServiceImpl implements IUserIntegralDetailService 
{
    @Autowired
    private UserIntegralDetailMapper userIntegralDetailMapper;

    /**
     * 查询用户积分明细
     * 
     * @param id 用户积分明细主键
     * @return 用户积分明细
     */
    @Override
    public UserIntegralDetail selectUserIntegralDetailById(Long id)
    {
        return userIntegralDetailMapper.selectUserIntegralDetailById(id);
    }

    /**
     * 查询用户积分明细列表
     * 
     * @param userIntegralDetail 用户积分明细
     * @return 用户积分明细
     */
    @Override
    public List<UserIntegralDetail> selectUserIntegralDetailList(UserIntegralDetail userIntegralDetail)
    {
        return userIntegralDetailMapper.selectUserIntegralDetailList(userIntegralDetail);
    }

    /**
     * 新增用户积分明细
     * 
     * @param userIntegralDetail 用户积分明细
     * @return 结果
     */
    @Override
    public int insertUserIntegralDetail(UserIntegralDetail userIntegralDetail)
    {
        userIntegralDetail.setCreateTime(DateUtils.getNowDate());
        return userIntegralDetailMapper.insertUserIntegralDetail(userIntegralDetail);
    }

    /**
     * 修改用户积分明细
     * 
     * @param userIntegralDetail 用户积分明细
     * @return 结果
     */
    @Override
    public int updateUserIntegralDetail(UserIntegralDetail userIntegralDetail)
    {
        userIntegralDetail.setUpdateTime(DateUtils.getNowDate());
        return userIntegralDetailMapper.updateUserIntegralDetail(userIntegralDetail);
    }

    /**
     * 批量删除用户积分明细
     * 
     * @param ids 需要删除的用户积分明细主键
     * @return 结果
     */
    @Override
    public int deleteUserIntegralDetailByIds(Long[] ids)
    {
        return userIntegralDetailMapper.deleteUserIntegralDetailByIds(ids);
    }

    /**
     * 删除用户积分明细信息
     * 
     * @param id 用户积分明细主键
     * @return 结果
     */
    @Override
    public int deleteUserIntegralDetailById(Long id)
    {
        return userIntegralDetailMapper.deleteUserIntegralDetailById(id);
    }

    @Override
    public List<UserIntegralDetail> jfxq(Long userId) {
        return userIntegralDetailMapper.jfxq(userId);
    }
}
